﻿using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Controls;
using Microsoft.Practices.ServiceLocation;
using ParaEditor.Infrastructure;

namespace ParaEditor.Desktop.View
{
    /// <summary>
    /// RechargeView.xaml 的交互逻辑
    /// </summary>
    [Export(ViewNames.MainViewName, typeof(UserControl))]
    [PartCreationPolicy(CreationPolicy.Shared)]
    public partial class MainView : UserControl
    {
        public MainView()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            ChangeView(ViewNames.Para3006ViewName);
        }

        private void ButtonVersion_Click(object sender, RoutedEventArgs e)
        {
            ChangeView(ViewNames.ParaVersionViewName);
        }

        private void Button3007_Click(object sender, RoutedEventArgs e)
        {
            ChangeView(ViewNames.Para3007ViewName);
        }

        private void Button3011_Click(object sender, RoutedEventArgs e)
        {
            ChangeView(ViewNames.Para3011ViewName);
        }

        private void Button3082_Click(object sender, RoutedEventArgs e)
        {
            ChangeView(ViewNames.Para3082ViewName);
        }

        private void Button3083_Click(object sender, RoutedEventArgs e)
        {
            ChangeView(ViewNames.Para3083ViewName);
        }

        private void Button3084_Click(object sender, RoutedEventArgs e)
        {
            ChangeView(ViewNames.Para3084ViewName);
        }

        private void Button3085_Click(object sender, RoutedEventArgs e)
        {
            ChangeView(ViewNames.Para3085ViewName);
        }

        private void Button4001_Click(object sender, RoutedEventArgs e)
        {
            ChangeView(ViewNames.Para4001ViewName);
        }

        private void Button4002_Click(object sender, RoutedEventArgs e)
        {
            ChangeView(ViewNames.Para4002ViewName);
        }

        private void Button4003_Click(object sender, RoutedEventArgs e)
        {
            ChangeView(ViewNames.Para4003ViewName);
        }

        private void Button4004_Click(object sender, RoutedEventArgs e)
        {
            ChangeView(ViewNames.Para4004ViewName);
        }

        private void Button4005_Click(object sender, RoutedEventArgs e)
        {
            ChangeView(ViewNames.Para4005ViewName);
        }

        private void Button4006_Click(object sender, RoutedEventArgs e)
        {
            ChangeView(ViewNames.Para4006ViewName);
        }

        private void Button4009_Click(object sender, RoutedEventArgs e)
        {
            ChangeView(ViewNames.Para4009ViewName);
        }

        private void Button4015_Click(object sender, RoutedEventArgs e)
        {
            ChangeView(ViewNames.Para4015ViewName);
        }

        private void Button4030_Click(object sender, RoutedEventArgs e)
        {
            ChangeView(ViewNames.Para4030ViewName);
        }

        private void ButtonQfPercent_Click(object sender, RoutedEventArgs e)
        {
            ChangeView(ViewNames.QfPercentViewName);
        }

        private void ChangeView(string ViewName)
        {
            this.MainContent.Content = ServiceLocator.Current.GetInstance((typeof(UserControl)), ViewName);
        }

        private void ButtonExit_Click(object sender, RoutedEventArgs e)
        {
            Application.Current.MainWindow.Close();
        }
    }
}
